package com.shop.enums;

import org.springframework.util.StringUtils;

/**
 * description: 会员是否有效的枚举
 *
 * @author zhaoxiaozhao（xiaozhao.zhao@ucarinc.com）
 * @version 1.0
 * @date 2018/10/10 10:10
 **/
public enum EffectiveEnum implements CodeEnum{
    BUYER_EFFECTIVE("1","有效"),
    BUYER_DELETE("0","无效"),;
    private String code;
    private String message;

    EffectiveEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public boolean equal(String code) {
        if(StringUtils.isEmpty(code)){
            return false;
        }
        if(this.code.equals(code)){
           return true;
        }
        return false;
    }

}
